package cn.bgs.service.impl;

import cn.bgs.config.DirectHdConfig;
import cn.bgs.config.DirectlyhConfig;
import cn.bgs.mapper.SodalityMapper;
import cn.bgs.mapper.ThematicActivitiesMapper;
import cn.bgs.pojo.Sodality;
import cn.bgs.pojo.ThematicActivities;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @program: town-digital
 * @description:
 * @author: Mr.Zhao
 * @create: 2022-08-13 14:29
 */

@Component
public class DircetReciveSodalityService {

    private static final Logger log = LoggerFactory.getLogger(DircetReciveSodalityService.class);

    @Autowired
    private SodalityMapper sodalityMapper;

    @RabbitListener(queues = DirectlyhConfig.DIRECT_QUEUE_NAME)
    public void recive(Sodality sodality){

        UpdateWrapper<Sodality> updateWrapper = new UpdateWrapper<>();
        updateWrapper.eq("id",sodality.getId()).set("sod_state","已发布");
        sodalityMapper.update(null, updateWrapper);





    }
}
